package com.pdg.mcplugin.ranger;

import org.bukkit.command.CommandSender;

import com.pdg.mcplugin.common.deprecated.DeprecatedPermissionCheckerBase;

public class PermissionChecker extends DeprecatedPermissionCheckerBase<Ranger> {

	private static final String PERMISSION_REMEMBER = "ranger.remember";
	private static final String PERMISSION_FIND = "ranger.find";
	private static final String PERMISSION_FORGET = "ranger.forget";
	private static final String PERMISSION_LIST = "ranger.list";
	private static final String PERMISSION_NEAREST = "ranger.nearest";
	private static final String PERMISSION_COMPASS = "ranger.compass";
	private static final String PERMISSION_RENAME = "ranger.rename";
	private static final String PERMISSION_PUBLIC_REMEMBER = "ranger.public.remember";
	private static final String PERMISSION_PUBLIC_FIND = "ranger.public.find";
	private static final String PERMISSION_PUBLIC_FORGET = "ranger.public.forget";
	private static final String PERMISSION_PUBLIC_LIST = "ranger.public.list";
	private static final String PERMISSION_PUBLIC_NEAREST = "ranger.public.nearest";
	private static final String PERMISSION_PUBLIC_COMPASS = "ranger.public.compass";
	private static final String PERMISSION_PUBLIC_RENAME = "ranger.public.rename";

	public PermissionChecker(Ranger thePlugin) {
		super(thePlugin);
		setDefault(PERMISSION_REMEMBER,false);
		setDefault(PERMISSION_FORGET,false);
		setDefault(PERMISSION_FIND,false);
		setDefault(PERMISSION_LIST,false);
		setDefault(PERMISSION_NEAREST,false);
	}
	
	public boolean hasRememberPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_REMEMBER);
	}

	public boolean hasForgetPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_FORGET);
	}

	public boolean hasFindPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_FIND);
	}

	public boolean hasListPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_LIST);
	}

	public boolean hasNearestPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_NEAREST);
	}

	public boolean hasCompassPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_COMPASS);
	}

	public boolean hasPublicRememberPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_REMEMBER);
	}

	public boolean hasPublicForgetPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_FORGET);
	}

	public boolean hasPublicFindPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_FIND);
	}

	public boolean hasPublicListPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_LIST);
	}

	public boolean hasPublicNearestPermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_NEAREST);
	}

	public boolean hasPublicRenamePermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_RENAME);
	}

	public boolean hasRenamePermission(CommandSender theCommandSender){
		return checkPermission(theCommandSender,PERMISSION_RENAME);
	}

	@Override
	protected boolean shouldSuppressNoPermissionMessages(
			String thePermissionName) {
		return false;
	}

	public boolean hasPublicCompassPermission(CommandSender theCommandSender) {
		return checkPermission(theCommandSender,PERMISSION_PUBLIC_COMPASS);
	}


}
